package com.zrar.ak.gkpt.dao;

import com.zrar.ak.gkpt.model.bo.BusinessBidPurchasePurchaseSystemSoftwareHardwareBO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

/**
 * @ClassName: IBusinessBidPurchasePurchaseSystemSoftwareHardwareDao
 * @Description 招标采购-采购-应用系统和基础软硬件表Dao层
 * @Author HuangKeXin
 * @Time 2020/04/3
 */
@Repository("businessBidPurchasePurchaseSystemSoftwareHardwareDao")
public interface IBusinessBidPurchasePurchaseSystemSoftwareHardwareDao extends Mapper<BusinessBidPurchasePurchaseSystemSoftwareHardwareBO> {
    @Select(("SELECT COUNT(1) AS TOTAL FROM BUSINESS_BID_PURCHASE_PURCHASE_SYSTEM_SOFTWARE_HARDWARE WHERE IS_DELETE='0' AND UNIT_ID=#{unitId}"))
    Integer queryExistCountByBusinessBidPurchaseUnitId(String unitId);

    @Update("UPDATE BUSINESS_BID_PURCHASE_PURCHASE_SYSTEM_SOFTWARE_HARDWARE SET IS_DELETE='1' WHERE IS_DELETE='0' AND UNIT_ID= #{unitId}")
    void deleteBusinessBidPurchaseByUnitId(String unitId);
}
